package file;

import java.io.File;
import java.io.FileFilter;

public class ListFilesDemo2 {
    public static void main(String[] args) {
        File dir = new File(".");
        FileFilter fileFilter = (File file)->file.getName().startsWith(".");
        File[] subs = dir.listFiles(fileFilter);
        System.out.println("当前目录下共有"+subs.length+"个子项");
    }
}
